package ru.urfc.portal.ui.client.widgets;

import ru.urfc.portal.ui.client.BaseGooglet;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;

public class BranchFilter extends BaseFilter {

	interface Binder extends UiBinder<Widget, BranchFilter> {}
	private static Binder binder = GWT.create(Binder.class);
	@UiField ComboBox<ModelData> selectBranch;
	@UiField Element placeForSearchButton;

	public BranchFilter() {
		initWidget(binder.createAndBindUi(this));
		descriptor.addSelectField(FILTER_BRANCH_CODE, selectBranch);
	}

	public void init(BaseGooglet googlet) {
		googlet.initCombobox("name", "code", "Все филиалы", selectBranch, BRANCH, CATALOGS, BRANCHES);
	}

	@Override
	protected Element getPlaceForSearchButton() {
		return placeForSearchButton;
	}
	
}

